package practice;

import java.util.Scanner;

public class Text04 {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        String id="admin";
        String password="admin";
        for (int i=3;i>0;){
            System.out.println("请输入用户名");
            String impid=scan.nextLine();
            System.out.println("请输入密码");
            String impassword=scan.nextLine();
            if(impid.equals(id)&&impassword.equals(password)){
                System.out.println("欢迎admin登录");
                break;
            }else {
                System.out.println("录入错误,您还有"+--i+"次机会");
            }
        }
    }
}
